Ext.define('Jason.view.main.MainContainerWrap', {
    extend: 'Ext.container.Container',
    xtype: 'maincontainerwrap',
    requires : [
        'Ext.layout.container.HBox'
    ],
    scrollable: 'y',
    layout: {
        type: 'hbox',
        // 1、left（默认）：排列于容器左侧。  
        // 2、center ：控件在容器水平居中。    
        // 3、stretch：控件横向拉伸至容器大小 。
        // 4、stretchmax:控件横向拉伸，宽度为最宽控件的宽。 
        align: 'stretchmax',
        // Tell the layout to animate the x/width of the child items.
        animate: true,
        animatePolicy: {
            x: true,
            width: true
        }
    },
    beforeLayout : function() {
        // We setup some minHeights dynamically to ensure we stretch to fill the height
        // of the viewport minus the top toolbar
        try {
            var me = this,
                height = Ext.Element.getViewportHeight() - 38,  // offset by topmost toolbar height
            // We use itemId/getComponent instead of "reference" because the initial
            // layout occurs too early for the reference to be resolved
                navTree = me.getComponent('navigationTreeList');

            me.minHeight = height;

            navTree.setStyle({
                'min-height': height + 'px'
            });

            me.callParent(arguments);
        }catch(e){
            var me = this,
                height = Ext.Element.getViewportHeight() - 38;
            me.height = height;
        }
    }
});
